﻿@model OMS.Models.OrderModelView

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@{
    ViewBag.Title = "AddOrder";
}

<h2>This page is appointed for analysing customer and perform ordering</h2>

<div>
    <table align=center>
    <tr>
        <th>Item Number</th>
        <th>Name</th>
        <th>Description</th>
        <th>Dimension</th>
        <th>Price</th>
        <th>Quantity</th>
    </tr>

@foreach (var order in Model.OrderItems)
{
        <tr>
            <td>
                @Html.DisplayFor(i => order.ItemModel.Id)
            </td>
            <td>
                @Html.DisplayFor(i => order.ItemModel.Name)
            </td>
            <td>
                @Html.DisplayFor(i => order.ItemModel.Description)
            </td>
            <td>
                @Html.DisplayFor(i => order.Dimension)
            </td>
            <td>
                @Html.DisplayFor(i => order.Price)
            </td>
            <td>
                @Html.DisplayFor(i => order.Quantity)
            </td>
        </tr>
}
</table>
</div>
<br />
<div align=center>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true) {
        <div>
            Totals <br />
            <table>
                <tr>
                    <td>Customer Name</td>
                    <td>Customer name[WIP]</td>
                </tr>
                <tr>
                    <td>Customer Type</td>
                    <td>Customer Name[WIP]</td>
                </tr>
                <tr>
                    <td>Order Number</td>
                    <td>@Html.DisplayFor(m => m.OrderNumber)</td>
                </tr>
                <tr>
                    <td>Total Price</td>
                    <td>@Html.DisplayFor(m => m.TotalPrice)</td>
                </tr>
                <tr>
                    <td>Total Number of Items</td>
                    <td>@Html.DisplayFor(m => m.NumberOfItems)</td>
                </tr>
                <tr>
                    <td>Assignee</td>
                    <td>Assignee[WIP]</td>
                </tr>
                <tr>
                    <td>Date of Ordering</td>
                    <td>@Html.DisplayFor(m => m.DateOfOrdering)</td>
                </tr>
                <tr>
                    <td>Preferable Delivery Date</td>
                    <td>@Html.DisplayFor(m => m.PrefDate)</td>
                </tr>
                <tr>
                    <td>Status</td>
                    <td>Ordered @Html.CheckBox("ordered", Model.Status=="ordered")
                    Delivered @Html.CheckBox("delivered", Model.Status=="delivered")</td>
                </tr>
                <tr>
                    <td>Delivery Date</td>
                    <td>@Html.Editor("deliveryDate", Model.DeliveryDate)</td>
                </tr>
            </table>
        </div>
        if (Model.Status != "delivered")
        {
            @Html.Hidden("orderId", Model.Id);
            <button type=submit>Save</button>
        }
                                  }
}
</div>